package com.seveneight.baijiesteward.ui.first.presenter;

import android.content.Context;

import com.seveneight.baijiesteward.base.TeamBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.first.contract.TeamListContract;
import com.seveneight.baijiesteward.ui.first.model.TeamListModel;

import java.util.List;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/4/4.
 */

public class TeamListPresenter implements TeamListContract.TeamListPresenter {

    TeamListContract.TeamListView teamListView;
    TeamListContract.TeamListModel teamListModel;

    public TeamListPresenter(TeamListContract.TeamListView teamListView){
        this.teamListView=teamListView;
        teamListModel=new TeamListModel();
    }
    @Override
    public void getTeamList(Context context, RequestBody body) {
        teamListModel.getTeamList(context, body, new MyCallBack<List<TeamBean>>() {
            @Override
            public void onSuccess(List<TeamBean> teamBeans) {
                teamListView.rebackTeamData(teamBeans);
            }

            @Override
            public void onFailed() {

            }
        });
    }
}
